package com.suxin.netty.coder;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.ReplayingDecoder;

import java.util.List;

/**
 * @author Tang
 * @classname MyReplayingDecoder
 * @description [ TODO ]
 * @date 2021/1/10 12:54
 */
public class MyReplayingDecoder extends ReplayingDecoder<Integer> {
    @Override
    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
        System.out.println("ReplayingDecoder 解码器执行...");
        out.add(in.readInt());
    }
}